-
Notifications
You must be signed in to change notification settings - Fork 139
feat: add StatsVerifier and commit-time stats validation #1667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
DrakeLin
wants to merge
8
commits into
delta-io:main
Choose a base branch
from
DrakeLin:stack/stats-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jan 23, 2026
a002d80 to
ff7d2c6
Compare
ff7d2c6 to
ade9d54
Compare
4cfcc4c to
85d4b15
Compare
- Add stats_columns parameter to write_parquet_file trait - Add stats_schema(), stats_columns(), get_clustering_columns() to Transaction - Add stats_columns to WriteContext - Update get_write_context() to take engine parameter - Add clustering column support to expected_stats_schema()
- Add StatisticsCollector struct with new(), update(), finalize()
- Track numRecords across multiple RecordBatches
- Output StructArray with {numRecords, tightBounds}
- Basic unit tests for single/multiple batches
This is the foundation for full stats collection, adding column-level
stats (nullCount, minValues, maxValues) in subsequent PRs.
- Add null count tracking for all columns - Support nested struct null counts - Merge null counts across multiple batches - Only collect for columns in stats_columns - Tests for null counting across batches
- Add min/max tracking for all supported types - Primitive types (int8-64, uint8-64, float32/64) - Date, timestamp with all time units - Decimal128 - String types with truncation to 32 chars - Merge min/max across multiple batches - Tests for min/max across single and multiple batches
- Add NullBuffer mask parameter to update() - Only count masked-in rows for numRecords - Only count nulls in masked-in rows for nullCount - Filter column by mask before computing min/max - Tests for mask behavior with min/max and null counting This enables deletion vector support where masked-out rows should not contribute to file statistics.
- Import StatisticsCollector in parquet.rs - Add stats field to DataFileMetadata with with_stats() method - Update as_record_batch to use full stats if available - Update write_parquet_file to collect and attach stats - Update mod.rs write_parquet to pass stats_columns - Update write tests to expect full stats output - Fix write-table example API call
- Add StatsVerifier with verify() and verify_detailed() methods - Add StatsValidationVisitor using RowVisitor pattern - Integrate validation into commit() flow - Add add_files_validated() and validate_add_files_stats() helpers - Unit tests for verifier functionality
85d4b15 to
dc1835f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
Use this link to review incremental changes.
What changes are proposed in this pull request?
How was this change tested?